﻿HmJS.$Import('image.effect.Greyscale');

HmJS.register('demo.module.image.effect.greyscale', function ($ns) {
	var that = {};

	that.todo = function () {

		// Attached on load as we need the images to of loaded!

		$$('img.coloured-image').each(function (element) {

			element.toGreyscale();

			// element.toSaturated will return image to saturated version if previously de-staurated with element.toGreyscale
			element.addEvent('mouseover', function (ev) {
				this.toSaturated();
			})
			element.addEvent('mouseout', function (ev) {
				this.toGreyscale();
			})
		});

	};

	return that;
});
